﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Products
{
   public class CartItem
    {

        #region Properties

        private Int32 _Order_Id;
        private Int32 _Product_Id;
        private String _Product_Name;
        private Int32 _Quantity;
        private Decimal _Price;
        private String _Unit;

        public Int32 OrderId
        {
            get { return _Order_Id; }
            set { _Order_Id = value; }
        }

        public Int32 ItemId
        {
            get { return _Product_Id; }
            set { _Product_Id = value; }
        }

        public String Name
        {
            get { return _Product_Name; }
            set { _Product_Name = value; }
        }

        public Int32 Quantity
        {
            get { return _Quantity; }
            set { _Quantity = value; }
        }

        public Decimal Price
        {
            get { return _Price; }
            set { _Price = value; }
        }

        public String Unit
        {
            get { return _Unit; }
            set { _Unit = value; }
        }

       public Decimal SubTotal
        {
            get
            {
                return _Quantity * _Price;
            }
        }

        #endregion

        #region   Constructor

        public CartItem()
        {
        }

        public CartItem(Int32 Product_Id, Int32 Quantity)
        {
            _Product_Id = Product_Id;
            _Quantity = Quantity;
        }

        public CartItem(Int32 Product_Id, String Product_Name, Int32 Quantity, Decimal Price, String Unit)
        {
            _Product_Id = Product_Id;
            _Product_Name = Product_Name;
            _Quantity = Quantity;
            _Price = Price;
            _Unit = Unit;
        }

        public CartItem(Int32 Order_Id, Int32 Product_Id, String Product_Name, Int32 Quantity, Decimal Price, String Unit)
        {
            _Order_Id = Order_Id;
            _Product_Id = Product_Id;
            _Product_Name = Product_Name;
            _Quantity = Quantity;
            _Price = Price;
            _Unit = Unit;
        }

        #endregion
    }
}
